function volageSubmit()
{
	var C = parseFloat( $("#capacity-input")[0].value * $("#capacity-unit")[0].value );
	var Q = parseFloat( $("#energy-input")[0].value * $("#energy-unit")[0].value );
	$( "#volage-input" )[0].value = deleteZero(Math.sqrt(2 * Q / C ) / $( "#volage-unit" )[0].value, 10);
}	
function capacitySubmit()
{
	var Q = parseFloat( $("#energy-input")[0].value * $("#energy-unit")[0].value );
	var V = parseFloat( $("#volage-input")[0].value * $("#volage-unit")[0].value );
	$( "#capacity-input" )[0].value = deleteZero(2 * Q / V / V / $("#capacity-unit")[0].value, 10);
}	
function energySubmit()
{
	var C = parseFloat( $("#capacity-input")[0].value * $("#capacity-unit")[0].value );
	var V = parseFloat( $("#volage-input")[0].value * $("#volage-unit")[0].value );
	$( "#energy-input" )[0].value = deleteZero(C * V * V / 2 / $("#energy-unit")[0].value, 10);
}	
function volageSubmit()
{
	$( "#HV-volage-input" )[0].value = $( "#volage-input" )[0].value;

}
function timeSubmit()
{
	var V = parseFloat( $("#volage-input")[0].value * $("#volage-unit")[0].value );
	var C = parseFloat( $("#capacity-input")[0].value * $("#capacity-unit")[0].value );
	$( "#energy-input" )[0].value = deleteZero(C * V * V / 2 / $("#energy-unit")[0].value, 10);
	var power = parseFloat( $("#power-input")[0].value * 1000 );
	var powerVolage = parseFloat( $("#HV-volage-input")[0].value * 1000 );
	var current = power / powerVolage;
	var time = V * C / current / $("#time-unit")[0].value;
	$( "#current" )[0].innerHTML = deleteZero(current, 10);
	$( "#time" )[0].innerHTML = deleteZero(time, 10);
	
}

//�����������룬ȥ����Ч��0
function deleteZero(number, bit)
{
	var result;
	result = (( number * Math.pow(10, bit) ).toFixed(0)) / Math.pow(10, bit);
	
	return result;
}
	
